package com.yx.cloud.activity;

import android.view.View;

import com.yx.cloud.R;
import com.yx.cloud.base.BaseActivity;
import com.yx.cloud.databinding.ExaminehelpActivityBinding;
import com.yx.cloud.utils.Intent_utils;
import com.yx.cloud.utils.RomUtils;
import com.yx.cloud.utils.SharedPrefsUtil;

/**
 * 配网帮助界面
 */
public class ExamineHelpActivity extends BaseActivity implements View.OnClickListener {
    private ExaminehelpActivityBinding binding;
    private String value, robotType;

    @Override
    public void onCreate() {
        value = SharedPrefsUtil.getValue(this, "EZandAP", "EZandAP", "EZ");
        binding = ExaminehelpActivityBinding.inflate(getLayoutInflater());
        robotType = getIntent().getStringExtra("device_type");
        setContentView(binding.getRoot());
//        TODO 文字和图片添加到config里
        if ("u3-full".equals(robotType)) {
            binding.tvHelpDescription.setText(getString(R.string.N_Help_Title));
            binding.tvHelpIllustrate1.setText(getString(R.string.N_Help_Step1_X3));
            binding.tvHelpIllustrate2.setText(getString(R.string.N_Help_Step2_X3));
            binding.tvHelpIllustrate3.setText(getString(R.string.N_Help_Step3_X3));
            binding.ivHelpPic1.setBackgroundResource(R.mipmap.examine_help1_icon_u3pro);
            binding.ivHelpPic2.setBackgroundResource(R.mipmap.examine_help2_icon_u3pro);
            binding.ivHelpPic3.setBackgroundResource(R.mipmap.examine_help3_icon_u3pro);
        } else {
            binding.tvHelpDescription.setText(getString(R.string.N_Help_Title));
            binding.tvHelpIllustrate1.setText(getString(R.string.N_Help_Step1_X3));
            binding.tvHelpIllustrate2.setText(getString(R.string.N_Help_Step2_X3));
            binding.tvHelpIllustrate3.setText(getString(R.string.N_Help_Step3_X3));
            binding.ivHelpPic1.setBackgroundResource(R.mipmap.examine_help1_icon_x3);
            binding.ivHelpPic2.setBackgroundResource(R.mipmap.examine_help2_icon_x3);
            binding.ivHelpPic3.setBackgroundResource(R.mipmap.examine_help3_icon_x3);
        }

        binding.ivExamineHelpReturn.setOnClickListener(this);
        binding.btnExamineHelpConfirm.setOnClickListener(this);

    }

    @Override
    public void onClick(View v) {
        if (RomUtils.isFastClick()) {
            return;
        }
        switch (v.getId()) {
            case R.id.iv_examineHelp_return:
                Intent_utils.backIntent(this);
                break;
            case R.id.btn_examineHelpConfirm:
                Intent_utils.enterIntent(this, SelectWIFIActivity.class);
                break;
        }
    }
}
